<!DOCTYPE html>
<!-- saved from url=(0036)http://wuweiwei.cardpack.360.cn/help -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<!--
	<link rel="stylesheet" href="../../../../beacon-web-fe/resource/css/cardpack/m_reseet.css">
	<link rel="stylesheet" href="../../../../beacon-web-fe/resource/css/cardpack/m_list.css">
	-->
	<link rel="stylesheet" href="./help_files/common.css">
	<link rel="stylesheet" href="./help_files/feedback.css">
</head>

<body class="feedback">
<form action="http://wuweiwei.cardpack.360.cn/help/add_suggestion" method="post" id="myForm" enctype="multipart/form-data" onsubmit="return app.submitForCheck()">
	<dl>
		<dt class="pad-left">
			问题和意见
		</dt>
		<dd>
			<textarea name="info" id="textarea" placeholder="请简要的描述你的问题和意见"></textarea>
		</dd>
		
		<dt class="pad-left">
			图片（选填,提供问题截图）
		</dt>
		<dd class="relative">
			<div class="upload-content">
				<span class="h"></span>
				<span class="v"></span>
			</div>
			<input name="image" id="upload" type="file" class="upload">
		</dd>
		
		<dt class="pad-left">
			联系电话
		</dt>
		<dd style="height:41px;">
			<input name="mobile" id="input_phone" type="text" placeholder="选填，便于我们与您联系" maxlength="11">
		</dd>
	</dl>

	<div class="pad-left pad-right">
		<button id="btn_submit" class="submit" type="submit" style="border:none;">
			提交
		</button>
	</div>
	<!--for gate-->
	<div id="page_ok" class="hide"></div>
	<!--end gate-->
</form>




<script type="text/javascript" src="./help_files/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="./help_files/wGate.js"></script>
<script type="text/javascript">

var app = {
	init : function(){
		this.gate = new wGate();
		this.gate.append({
			name:"ok",
			content : $("#page_ok")[0],
			direction : "toLeft",
			backgroundColor : "#eee"
		});
		$("#myForm").attr("onsubmit","return app.submitForCheck()");
		this.bindEvent();
	} ,
	bindEvent : function(){
		var result = $(".feedback .upload-content")[0];
		$("#upload")[0].onchange = function(e){

		    var file = this.files[0]; 
		    if(!/image\/\w+/.test(file.type)){ 
		        alert("文件必须为图片！"); 
		        return false; 
		    } 

		    var reader = new FileReader(); 
		    reader.readAsDataURL(file); 
		    reader.onload = function(e){
		        result.innerHTML = '<img src="'+this.result+'" width="60" height="60" alt="you image"/>' ;
		        //var formData = new FormData(document.getElementById("myForm"));
		        //formData.append("file" , file);

		        /*
				$.ajax({
				  url: "help/add_suggestion",
				  type: "POST",
				  data: formData,
				  processData: false,  // 告诉jQuery不要去处理发送的数据
				  contentType: false   // 告诉jQuery不要去设置Content-Type请求头
				});
				*/
		    }
		}/*end change*/


		$("#textarea")[0].onkeyup = function(e){
			var evt = e || window.event;
			var target = evt.target || evt.srcElement;

			if(this.value.length>0)
			{
				$("#btn_submit").removeClass("submit");
				$("#btn_submit").addClass("submitH");
			}
			else
			{
				$("#btn_submit").removeClass("submitH");
				$("#btn_submit").addClass("submit");				
			}
		}

		$("#input_phone")[0].onkeypress = function(e){
			var evt = e || window.event;
			if(evt.keyCode>=48 && evt.keyCode<=57)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		$("#btn_submit").on("click",function(){
			if(this.className=="submitH" && $("#textarea")[0].value.length>0)
			{
				app.gate.show("ok");
			}
		});
	} , /*end bindEvent*/
	submitForCheck : function(){
		var $btn_submit = $("#btn_submit");
		if($btn_submit[0].className=="submitH")
		{
			return true;
		}
		else
		{
			return false;
		}
	}
};

app.init();

//alert(ArrayBuffer);



</script><div id="wGate_ok" style="position: fixed; height: 100%; width: 100%; overflow: auto; left: 100%; top: 0%; background-color: rgb(238, 238, 238);">
		<div class="success">
			<i>&nbsp;</i>
			<span>反馈成功！</span>
			<p>
				感谢您对我们的关注和支持,我们会认真处理<br>
				您的反馈,尽快修复和完善相关功能。
			</p>
		</div>
	</div>

</body></html>